package com.cby.android.sample.repository

import com.cby.android.sample.repository.api.ApiSource
import com.cby.android.sample.repository.api.ZhiXinService
import com.cby.android.sample.bean.zhixin.ZhiXinApiResponse
import com.cby.android.sample.bean.zhixin.ZhiXinResultsBean

/**
 * @description: ZhiXinRepository
 * @author: ChenBaoYang
 * @createDate: 2022/5/6 3:03 下午
 */
interface ZhiXinApi {
    suspend fun getLifeSuggestion(location: String?): ZhiXinApiResponse<ZhiXinResultsBean>
}

class ZhiXinApiImpl : ZhiXinApi {

    private var service: ZhiXinService = ApiSource.getXinZhiWeatherService(ZhiXinService::class.java)

    override suspend fun getLifeSuggestion(
        location: String?
    ): ZhiXinApiResponse<ZhiXinResultsBean> = service.getLifeSuggestion(ApiSource.XIN_ZHI_APP_SECRET, location)
}